<?php
//蜘蛛爬行管理
class spiderMod extends commonMod {

	public function __construct()
    {
        parent::__construct();
    }

	public function index() {

        $where_url='';
        $order='id desc';
        //分页信息
        $url = __URL__ . '/index/'.$where_url.'page-{page}.html'; //分页基准网址
        $listRows = 15;
        $limit=$this->pagelimit($url,$listRows);
        //内容列表
        $this->list=model('spider')->spider_list($where,$limit,$order);
        //统计总内容数量
        $count=model('spider')->count($where);
        $this->assign('page', $this->page($url, $count, $listRows));
		$this->show();  
	}
    //批量操作
    public function batch() {
        $status=intval($_POST['status']);
        $this->alert_str($status,'',true);
        $this->alert_str($_POST['id'],'',true);
        $id_array=substr($_POST['id'],0,-1);
        $id_array=explode(',', $id_array);

        switch ($status) {
            case 1:
                foreach ($id_array as $value) {
                    model('spider')->del($value);
                }
                $this->msg('蜘蛛记录删除成功！',1);
                break;
        }
        
    }
	

}